﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Theme2
{
	public class Calculator3
	{
		public static double CalculateSalaryByLevel(int level)
		{
			double minCoef = Power(Program.SalaryBaseCoef, level);
			double maxCoef = Power(Program.SalaryBaseCoef, level + 1);
			double salary = Average(minCoef * Program.SalaryBaseValue, maxCoef * Program.SalaryBaseValue);
			return salary;
		}

		public static double Average(double a, double b)
		{
			double result = (a + b) / 2;
			return result;
		}

		public static double Power(double x, int n)
		{
			double result = x;
			for (int i = 0; n >= i; i++)
			{
				result = result * x;
			}
			return result;
		}
	}
	public class Calculator_Alexei_Soin
	{
		public static double CalculateSalaryByLevel(int level)
		{
			double minCoef = Power(Program.SalaryBaseCoef, level);
			double maxCoef = Power(Program.SalaryBaseCoef, level + 1);
			double salary = Average(minCoef * Program.SalaryBaseValue, maxCoef * Program.SalaryBaseValue);
			return salary;
		}
		public static double Average(double a, double b)
		{
			double result = (a + b) / 2;
			return result;
		}
		public static double Power(double x, int n)
		{
			double result = 1;
			for (int i = 0; n > i; i++)
			{
				result = result * x;
			}
			return result;
		}
	}
}
